package com.src.hb.model;

import java.util.Date;

public class Timer {
	public static int MAX_COUNT_TRY = 3;
	/**
	 * Identyfikator timera
	 */
	private Integer tm_id;
	/**
	 * Nazwa timera
	 */
	private String tm_name;
	/**
	 * Nazwa metody wywoływanej przez timer
	 */
	private String tm_method;
	/**
	 * Interval wywolania timera
	 */
	private Integer tm_interval;
	/**
	 * Czy timer jest aktywny?
	 */
	private Boolean tm_active;
	/**
	 * Godziny wywolania timera<br>
	 * <b>EXAMPLE:</b><br>
	 * <li>07:30|
	 * <li>00:30|04:00|etc.
	 */
	private String tm_hours;
	/**
	 * Następne wywołanie timera
	 */
	private Date tm_next_call;
	/**
	 * Liczba nieudanych prób wykonania timera;
	 */
	private int failedAttempts=0;
	
	/**
	 * Konstruktor
	 */
	public Timer(){
		
	}

	public Integer getTm_id() {
		return tm_id;
	}

	public void setTm_id(Integer tm_id) {
		this.tm_id = tm_id;
	}

	public String getTm_name() {
		return tm_name;
	}

	public void setTm_name(String tm_name) {
		this.tm_name = tm_name;
	}

	public String getTm_method() {
		return tm_method;
	}

	public void setTm_method(String tm_method) {
		this.tm_method = tm_method;
	}

	public Integer getTm_interval() {
		return tm_interval;
	}

	public void setTm_interval(Integer tm_interval) {
		this.tm_interval = tm_interval;
	}

	public Boolean getTm_active() {
		return tm_active;
	}

	public void setTm_active(Boolean tm_active) {
		this.tm_active = tm_active;
	}

	public String getTm_hours() {
		return tm_hours;
	}

	public void setTm_hours(String tm_hours) {
		this.tm_hours = tm_hours;
	}

	public Date getTm_next_call() {
		return tm_next_call;
	}

	public void setTm_next_call(Date tm_next_call) {
		this.tm_next_call = tm_next_call;
	}
	

	public int getFailedAttempts() {
		return failedAttempts;
	}

	public void setFailedAttempts(int failedAttempts) {
		this.failedAttempts = failedAttempts;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("Timer [tm_id=");
		builder.append(tm_id);
		builder.append(", tm_name=");
		builder.append(tm_name);
		builder.append(", tm_method=");
		builder.append(tm_method);
		builder.append(", tm_interval=");
		builder.append(tm_interval);
		builder.append(", tm_active=");
		builder.append(tm_active);
		builder.append(", tm_hours=");
		builder.append(tm_hours);
		builder.append(", tm_next_call=");
		builder.append(tm_next_call);
		builder.append("]");
		return builder.toString();
	}
	
	
	
	
	

}
